#include <stdio.h>

struct student
{
	char sno[8];
	char name[20];
	char sex;
	int age;
	double score;
};

struct student *max(struct student *p1, struct student *p2);

int main(void)
{	
	struct student s1 = {"2015001", "LiMing", 'M', 18, 92.5};
	struct student s2 = {"2015002", "WangFang", 'F', 18, 95.5};
	struct student *q;
	
	q = max(&s1, &s2);
	printf("sno: %s\n", q->sno);
	printf("name: %s\n", q->name);
	printf("sex: %c\n", q->sex);
	printf("age: %d\n", q->age);
	printf("score: %4.1f\n", q->score);

	return 0;
}

struct student *max(struct student *p1, struct student *p2)
{
	if (p1->score > p2->score)
		return p1;
	else
		return p2;
}